# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/21 下午3:39
 @Author  : tgy
 
"""
import os

def test01():
    ...
    # *param 其中的param被赋值成列表
    a, *b = '123'
    print(a, b)
    # 可以使用 *_来忽略掉数据
    c, *_ = '233'


def sum(nums):
    # nums如果没有元素与之对应，则为[]
    first, *nums = nums
    return first + sum(nums) if nums else first


def sum_01(nums):
    ...
    s = 0
    while nums:
        first, *nums = nums
        s += first
    return s


def test02():
    ...
    a = 10, 20
    print(type(a))
    #
    a = b = []
    a.append(1)
    b.append(2)
    print(a, b)


def extend_add():
    ...
    n = [1, 2, 3]
    # extend 在原来的列表中添加
    n.extend([4, 5])
    print(n)

    m = [1,2,3]
    # + 是两个列表合并生成一个新的列表
    k = m + [4,5]
    print(m,k)


class Person(object):
    ...
    def __init__(self):
        self.__name = '1222'


if __name__ == '__main__':
    ...
    # test01()
    # print(sum_01([1, 2, 3]))
    # test02()
    # print(dir(Person()))
    # extend_add()
    # print(os.popen('ls /'))
    # for x in os.popen('find  /etc -name bashrc'):
    #     print(x,end='')
    #
    print(int.__doc__)